﻿using BAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Admin
{
    public partial class Login : System.Web.UI.Page
    {
        Control_Account var = new Control_Account();
        Account data = new Account();
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void login_Click(object sender, EventArgs e)
        {
            string username = Request.Form["Username"];
            string password = Request.Form["Password"];
            bool check = var.Account_CheckLogin(username, password);
            if (check == true)
            {
                Session["admin"] = username;
                Response.Write("<script>alert('Login Success')</script>");
                Response.Redirect("~/Admin/Index.aspx");
            }
            else
            {
                Response.Write("<script>alert('Username or Password invalid')</script>");
            }
        }
    }
}